package com.pj.wisdomlogistics.api;


import com.pj.wisdomlogistics.entity.ApplyDetailInfo;
import com.pj.wisdomlogistics.entity.CarDetailInfo;
import com.pj.wisdomlogistics.entity.CarPoritionInfo;
import com.pj.wisdomlogistics.entity.HomePageInfo;
import com.pj.wisdomlogistics.entity.MeetingPlanSimpleInfo;
import com.pj.wisdomlogistics.entity.MeetingSimpleInfo;
import com.pj.wisdomlogistics.entity.MyApplySimpleInfo;
import com.pj.wisdomlogistics.entity.PlanCar;
import com.pj.wisdomlogistics.entity.QuLeaderInfo;
import com.pj.wisdomlogistics.entity.RepairDetailInfo;
import com.pj.wisdomlogistics.entity.RepairPeopleInfo;
import com.pj.wisdomlogistics.entity.RepairQuestions;
import com.pj.wisdomlogistics.entity.ServicePersonnel;
import com.pj.wisdomlogistics.entity.TakeoutDetailInfo;
import com.pj.wisdomlogistics.entity.TakeoutMenuInfo;
import com.pj.wisdomlogistics.entity.TransactHistoryInfo;
import com.pj.wisdomlogistics.entity.VersionEntity;
import com.pj.wisdomlogistics.entity.WeekSsMenuInfo;
import com.pj.wisdomlogistics.entity.response.BaseResponse;
import com.pj.wisdomlogistics.entity.response.FoodMenu;
import com.pj.wisdomlogistics.entity.response.LoginResponse;
import com.pj.wisdomlogistics.entity.response.MealDetailInfo;

import java.util.List;

import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

public interface ApiService {
    @POST("checkLogin.do")
    Observable<LoginResponse> login(
            @Query("uid") String userName,
            @Query("password") String password);

    @POST("login.do")
    Observable<LoginResponse> login_jc(
            @Query("uid") String userName);

    @POST("checkVersion.do")
    Observable<BaseResponse<VersionEntity>> checkVersion();

    @POST("checkLogin.do")
    Observable<LoginResponse> checkLogin(
            @Query("accessToken") String accessToken);

    @POST("findOutFoodList.do")
    Observable<BaseResponse<TakeoutMenuInfo>> findOutFoodList(
            @Query("place") int place);

    @POST("findCookFoodList.do")
    Observable<BaseResponse<List<WeekSsMenuInfo>>> findCookFoodList();

    @POST("submitFoodApply.do")
    Observable<BaseResponse> submitFoodApply(
            @Query("cookFood") String cookFood,
            @Query("outFood") String outFood,
            @Query("userID") String userID,
            @Query("place") int place);

    @POST("findFoodApplyDetail.do")
    Observable<BaseResponse<TakeoutDetailInfo>> findFoodApplyDetail(
            @Query("outFoodID") int outFoodID);

    @POST("foodApplyFinish.do")
    Observable<BaseResponse> foodApplyFinish(
            @Query("outFoodID") int outFoodID);

    @POST("cancelFoodApply.do")
    Observable<BaseResponse> cancelFoodApply(
            @Query("outFoodID") int outFoodID);

    @POST("findMeetingRoomList.do")
    Observable<BaseResponse<List<MeetingSimpleInfo>>> findMeetingRoomList();

    @POST("myApply.do")
    Observable<BaseResponse<MyApplySimpleInfo>> myApply(
            @Query("userID") String userID,
            @Query("applyType") int applyType,
            @Query("timeType") int timeType,
            @Query("state") int state,
            @Query("pageIndex") int pageIndex,
            @Query("pageNumber") int pageNumber
    );

    @POST("submitMeetingApply.do")
    Observable<BaseResponse<Integer>> submitMeetingApply(
            @Query("userID") String userID,
            @Query("linkman") String linkman,
            @Query("officeTel") String officeTel,
            @Query("linkmanTel") String linkmanTel,
            @Query("meetingDate") String meetingDate,
            @Query("startTime") String startTime,
            @Query("endTime") String endTime,
            @Query("meetingContent") String meetingContent,
            @Query("meetingRoomID") int meetingRoomID,
            @Query("isSchedule") int isSchedule,
            @Query("peopleCount") String peopleCount,
            @Query("rostrumCount") String rostrumCount,
            @Query("mikeCount") int mikeCount,
            @Query("standMike") String standMike,
            @Query("music") int music,
            @Query("banner") String banner,
            @Query("otherService") String otherService,
            @Query("isLift") String isLift,
            @Query("openTime") String openTime,
            @Query("place") String place
    );

    @POST("findMeetingApplyDetail.do")
    Observable<BaseResponse<ApplyDetailInfo>> findMeetingApplyDetail(
            @Query("meetingApplyID") int meetingApplyID);

    @POST("myTodo.do")
    Observable<BaseResponse<MyApplySimpleInfo>> myTodo(
            @Query("userID") String userID,
            @Query("applyType") int applyType,
            @Query("timeType") int timeType,
            @Query("state") int state,
            @Query("pageIndex") int pageIndex,
            @Query("pageNumber") int pageNumber
    );

    @POST("meetingApplyComment.do")
    Observable<BaseResponse> meetingApplyComment(
            @Query("meetingApplyID") int meetingApplyID,
            @Query("userID") String userID,
            @Query("comment") String comment
    );


    @POST("findAllServer.do")
    Observable<BaseResponse<List<ServicePersonnel>>> findAllServer();


    @POST("meetingApplyAllot.do")
    Observable<BaseResponse> meetingApplyAllot(
            @Query("meetingApplyID") int meetingApplyID,
            @Query("userID") String userID,
            @Query("comment") String comment,
            @Query("serverIDs") String serverIDs,
            @Query("state") int state
    );

    @POST("submitCarApply.do")
    Observable<BaseResponse<Integer>> submitCarApply(
            @Query("userID") String userID,
            @Query("userName") String userName,
            @Query("userTel") String userTel,
            @Query("applyDeptID") String applyDeptID,
            @Query("applyDept") String applyDept,
            @Query("officeTel") String officeTel,
            @Query("applyReason") String applyReason,
            @Query("goalPlace") String goalPlace,
            @Query("detailReason") String detailReason,
            @Query("peopleCount") String peopleCount,
            @Query("usingTime") String usingTime,
            @Query("linkman") String linkman,
            @Query("linkmanTel") String linkmanTel,
            @Query("isAfterApply") int isAfterApply,
            @Query("place") String place
    );

    @POST("findCarApplyDetail.do")
    Observable<BaseResponse<CarDetailInfo>> findCarApplyDetail(
            @Query("carApplyID") int carApplyID);


    @POST("findQuestions.do")
    Observable<BaseResponse<List<RepairQuestions>>> findQuestions();

    @POST("findRepairDetail.do")
    Observable<BaseResponse<RepairDetailInfo>> findRepairDetail(
            @Query("repairApplyID") int repairApplyID);

    @POST("orderRepair.do")
    Observable<BaseResponse> orderRepair(
            @Query("userID") String userID,
            @Query("repairApplyID") int repairApplyID
    );

    @POST("submitDiningApply.do")
    Observable<BaseResponse<Integer>> submitDiningApply(
            @Query("userID") String userID,
            @Query("applyDeptID") String applyDeptID,
            @Query("linkman") String linkman,
            @Query("linkmanTel") String linkmanTel,
            @Query("officeTel") String officeTel,
            @Query("diningType") int diningType,
            @Query("diningBenchmark") int diningBenchmark,
            @Query("diningReason") String diningReason,
            @Query("peopleCount") int peopleCount,
            @Query("diningTime") String diningTime,
            @Query("leaderID") String leaderID,
            @Query("remark") String remark,
            @Query("place") String place
    );

    @POST("findDiningApplyDetail.do")
    Observable<BaseResponse<MealDetailInfo>> findDiningApplyDetail(
            @Query("diningApplyID") int diningApplyID);

    @POST("carApplyComment.do")
    Observable<BaseResponse> carApplyComment(
            @Query("userID") String userID,
            @Query("carApplyID") int carApplyID,
            @Query("comment") String comment,
            @Query("state") int state);

    @POST("diningApplyReview.do")
    Observable<BaseResponse> diningApplyReview(
            @Query("userID") String userID,
            @Query("diningApplyID") int diningApplyID,
            @Query("state") String state,
            @Query("comment") String comment);

    @POST("diningApplyFinish.do")
    Observable<BaseResponse> diningApplyFinish(
            @Query("userID") String userID,
            @Query("diningApplyID") int diningApplyID,
            @Query("state") String state,
            @Query("comment") String comment,
            @Query("room") String room);

    @POST("findCarAndDriver.do")
    Observable<BaseResponse<CarPoritionInfo>> findCarAndDriver();

    @POST("carApplyAllot.do")
    Observable<BaseResponse> carApplyAllot(
            @Query("userID") String userID,
            @Query("carApplyID") String carApplyID,
            @Query("state") String state,
            @Query("driverName") String driverName,
            @Query("driverTel") String driverTel,
            @Query("carModel") String carModel,
            @Query("carNum") String carNum,
            @Query("driverID") String driverID,
            @Query("carID") String carID,
            @Query("comment") String comment
    );

    @POST("findFixWorker.do")
    Observable<BaseResponse<List<RepairPeopleInfo>>> findFixWorker();

    @POST("repairAllot.do")
    Observable<BaseResponse> repairAllot(
            @Query("userID") String userID,
            @Query("fixWorkerID") String fixWorkerID,
            @Query("fixWorkerName") String fixWorkerName,
            @Query("fixWorkerTel") String fixWorkerTel,
            @Query("repairApplyID") String repairApplyID,
            @Query("comment") String comment,
            @Query("state") String state
    );

    @POST("carApplyAssess.do")
    Observable<BaseResponse> carApplyAssess(
            @Query("assess") String assess,
            @Query("carApplyID") String carApplyID,
            @Query("levels") int levels
    );

    @POST("assessRepair.do")
    Observable<BaseResponse> assessRepair(
            @Query("assess") String assess,
            @Query("repairApplyID") String repairApplyID,
            @Query("levels") int levels
    );

    @POST("home.do")
    Observable<BaseResponse<HomePageInfo>> home(
            @Query("userID") String userID);

    @POST("alreadydo.do")
    Observable<BaseResponse<TransactHistoryInfo>> alreadydo(
            @Query("userID") String userID,
            @Query("timeString") String timeString
    );

    @POST("meetingTimeAxis.do")
    Observable<BaseResponse<List<MeetingPlanSimpleInfo>>> meetingTimeAxis(
            @Query("meetingRoomID") int meetingRoomID
    );

    @POST("regist.do")
    Observable<BaseResponse> regist(
            @Query("loginName") String loginName,
            @Query("password") String password,
            @Query("name") String name,
            @Query("mobile") String mobile
    );

    @POST("userMsg.do")
    Observable<BaseResponse<String>> userMsg(
            @Query("mobile") String mobile
    );

    @POST("meetingApplyReview.do")
    Observable<BaseResponse> meetingApplyReview(
            @Query("meetingApplyID") int meetingApplyID,
            @Query("userID") String userID,
            @Query("comment") String comment,
            @Query("state") int state
    );

    @POST("checkLeader.do")
    Observable<BaseResponse<List<QuLeaderInfo>>> checkLeader();

    @POST("updateCarState.do")
    Observable<BaseResponse> updateCarState(
            @Query("carID") int carID,
            @Query("state") int state
    );

    @POST("mofifyPassword.do")
    Observable<BaseResponse> mofifyPassword(
            @Query("userID") String userID,
            @Query("newPassword") String newPassword,
            @Query("oldPassword") String oldPassword
    );

    @POST("carApplyFinish.do")
    Observable<BaseResponse> carApplyFinish(
            @Query("userID") String userID,
            @Query("carApplyID") int carApplyID,
            @Query("beforeMile") String beforeMile,
            @Query("afterMile") String afterMile
    );

    @POST("meetingApplyKZ.do")
    Observable<BaseResponse> meetingApplyKZ(
            @Query("userID") String userID,
            @Query("meetingApplyID") String meetingApplyID,
            @Query("state") String state,
            @Query("comment") String comment
    );

    @POST("carTimeAxis.do")
    Observable<BaseResponse<List<PlanCar>>> carTimeAxis(
            @Query("carID") int carID
    );

    @POST("cancelCar.do")
    Observable<BaseResponse> cancelCar(
            @Query("carApplyID") int carApplyID
    );

    @POST("cancelDiningApply.do")
    Observable<BaseResponse> cancelDiningApply(
            @Query("diningApplyID") int diningApplyID
    );

    @POST("cancelMeetingApply.do")
    Observable<BaseResponse> cancelMeetingApply(
            @Query("meetingApplyID") int meetingApplyID
    );

    //查看面食菜单
    @POST("findNoodleFood.do")
    Observable<BaseResponse<List<FoodMenu>>> findNoodleFood(
            @Query("userID") String userID
    );


    //查看熟食菜单
    @POST("findCookFood.do")
    Observable<BaseResponse<List<FoodMenu>>> findCookFood();

    //查看熟食菜单2
    @POST("findCookFood2.do")
    Observable<BaseResponse<List<FoodMenu>>> findCookFood2(@Query("userID") String userID);

    //编辑面食菜单
    @POST("modifyNoodleMenu.do")
    Observable<BaseResponse> modifyNoodleMenu(
            @Query("foodJson") String foodJson,
            @Query("userID") String userID
    );

    //编辑熟食菜单
    @POST("modifyMenu.do")
    Observable<BaseResponse> modifyMenu(
            @Query("foodJson") String foodJson
    );

    @POST("getTimestamp.do")
    Observable<BaseResponse<String>> getTimestamp();
}


